<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <menu-list :title='age'></menu-list>
  </div>
  <script src="../vue.js"></script>
  <script>
    Vue.component('menuAge', {
      props: ['titleAge'],
      data: function () {
        return {
          name: 'jerry'
        }
      },
      template: `
        <div>
          <p>{{ name }}</p>
          <p>{{ titleAge }}</p>
        </div>
      `
    })

    Vue.component('menu-list', {
      props: ['title'],
      data: function () {
        return {
          name: 'tom'
        }
      },
      template: `
        <div>
          <p>{{ name }}</p>
          <p>{{ title }}</p>
          <menu-age titleAge = '25'></menu-age>
        </div>
      `
    })

    var vm = new Vue({
      el: '#app',
      data: {
        age: 20
      },
    })
  </script>
</body>

</html>